/**
 * 
 */
package com.authManager.web.model;

import java.util.ArrayList;
import java.util.List;

import com.commons.base.model.AdminPage;
import com.commons.base.model.ResultData;

/**
 * 现在接口比较少 直接new 手动转一下 实际生产中 请用spring aop 自动转一下数据吧
 * 
 * @author 小旋风
 *
 */
public class LayuiTableData<T> {
	public LayuiTableData(ResultData<AdminPage<T>> data) {
		this.isOk = data.getIsOk();
		this.code = data.getCode();
		this.message = data.getMessage();
		if (data.getData() != null) {
			this.records = data.getData().getRecords();
			this.total = data.getData().getTotal();
		}
	}

	private Boolean isOk = null;
	private String code = null;
	private String message = null;
	private List<T> records = new ArrayList<>();
	private int total = 0;

	public Boolean getIsOk() {
		return isOk;
	}

	public void setIsOk(Boolean isOk) {
		this.isOk = isOk;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public List<T> getRecords() {
		return records;
	}

	public void setRecords(List<T> records) {
		this.records = records;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

}
